import scala.io.StdIn._
class Calculator{
    def calculate(a:Int,b:Int,op:String):Any={
        op match {
            case "+"=>a+b
            case "-"=>a-b
            case "*"=>a*b
            case "/" if (b != 0)=>a/b
            case _=>"Invalid operator"
        }
    }
}
object Main{
    def main(args:Array[String]):Unit={
        val calculator = new Calculator
        println(calculator.calculate(2,7,"+"))
        println(calculator.calculate(2,7,"-"))
        println(calculator.calculate(2,7,"*"))
        println(calculator.calculate(2,7,"/"))
        println(calculator.calculate(2,7,"%"))
    }
}
